package com.gitee.free.coding.admin.system.service.impl;

import com.gitee.free.coding.admin.system.entity.SystemUser;
import com.gitee.free.coding.admin.system.logic.SystemUserLogic;
import com.gitee.free.coding.admin.system.mapstruct.mapper.SystemUserMapstructMapper;
import com.gitee.free.coding.admin.system.service.ISystemUserService;
import com.gitee.free.coding.admin.system.vo.SystemUserVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author liaoen
 * @since 2024-05-29 22:44:05
 */
@Service
public class SystemUserServiceImpl implements ISystemUserService {

    @Autowired
    private SystemUserLogic systemUserLogic;

//    @Override
//    public Page<SystemUser> pageUsers() {
//        Page<SystemUser> page = new Page<>(1, 2);
//        QueryWrapper<SystemUser> queryWrapper = new QueryWrapper<>();
//        return systemUserMapper.selectPage(page, queryWrapper);
//    }


    @Override
    public SystemUserVO getActiveUserByUserName(String userName) {
        SystemUser activeUser = systemUserLogic.getActiveUserByUserName(userName);
        return SystemUserMapstructMapper.INSTANCE.toSystemUserVO(activeUser);
    }

}
